﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using YJKWndrStatisticsExcel.AreaTable.StatisticControler;

namespace YJKWndrStatisticsExcel.AreaTable.Forms
{
	public partial class StatisticalResultForm : System.Windows.Forms.Form
	{
		public StatisticalResultForm(StatisticalResultData resultData)
		{
			this.m_ResultData = resultData;
			this.InitializeComponent();
		}

		public int TableIndex
		{
			get
			{
				return this.tabControl.SelectedIndex;
			}
			set
			{
				if (value >= 0 && value < this.tabControl.TabCount)
				{
					this.tabControl.SelectedIndex = value;
				}
			}
		}

		private void StatisticalResultForm_Load(object sender, EventArgs e)
		{
			this.m_ArchAreaStatisticalForm = new ArchAreaStatisticalForm(this.m_ResultData.m_AASData);
			this.m_ArchAreaStatisticalForm.TopLevel = false;
			this.m_ArchAreaStatisticalForm.Dock = DockStyle.Fill;
			this.m_ArchAreaStatisticalForm.FormBorderStyle = FormBorderStyle.None;
			this.tabPage1.Controls.Add(this.m_ArchAreaStatisticalForm);
			this.m_ArchAreaStatisticalForm.Show();
			this.m_EstateSuiteAreaStatisticalForm = new EstateSuiteAreaStatisticalForm(this.m_ResultData.m_FloorNameList, this.m_ResultData.m_ESASData);
			this.m_EstateSuiteAreaStatisticalForm.TopLevel = false;
			this.m_EstateSuiteAreaStatisticalForm.Dock = DockStyle.Fill;
			this.m_EstateSuiteAreaStatisticalForm.FormBorderStyle = FormBorderStyle.None;
			this.tabPage2.Controls.Add(this.m_EstateSuiteAreaStatisticalForm);
			this.m_EstateSuiteAreaStatisticalForm.Show();
			this.m_HouseSuiteAreaStatisticalForm = new HouseSuiteAreaStatisticalForm(this.m_ResultData.m_FloorNameList, this.m_ResultData.m_HSASData);
			this.m_HouseSuiteAreaStatisticalForm.TopLevel = false;
			this.m_HouseSuiteAreaStatisticalForm.Dock = DockStyle.Fill;
			this.m_HouseSuiteAreaStatisticalForm.FormBorderStyle = FormBorderStyle.None;
			this.tabPage3.Controls.Add(this.m_HouseSuiteAreaStatisticalForm);
			this.m_HouseSuiteAreaStatisticalForm.Show();
			this.m_HouseSuiteAreaAnalyzeForm = new HouseSuiteAreaAnalyzeForm(this.m_ResultData.m_HSAAData);
			this.m_HouseSuiteAreaAnalyzeForm.TopLevel = false;
			this.m_HouseSuiteAreaAnalyzeForm.Dock = DockStyle.Fill;
			this.m_HouseSuiteAreaAnalyzeForm.FormBorderStyle = FormBorderStyle.None;
			this.tabPage4.Controls.Add(this.m_HouseSuiteAreaAnalyzeForm);
			this.m_HouseSuiteAreaAnalyzeForm.Show();
		}

		private void btnDrawTable_Click(object sender, EventArgs e)
		{
			this.m_nDlgResult = 0u;
		}

		private void btnExport_Click(object sender, EventArgs e)
		{
			this.m_nDlgResult = 1u;
		}

		public uint m_nDlgResult;

		private StatisticalResultData m_ResultData;

		private ArchAreaStatisticalForm m_ArchAreaStatisticalForm;

		private EstateSuiteAreaStatisticalForm m_EstateSuiteAreaStatisticalForm;

		private HouseSuiteAreaStatisticalForm m_HouseSuiteAreaStatisticalForm;

		private HouseSuiteAreaAnalyzeForm m_HouseSuiteAreaAnalyzeForm;
	}
}
